package com.media.publish.adapter

import com.baselibrary.bean.ReleaseTopicBean
import com.baselibrary.extension.checkNotNull
import com.baselibrary.extension.checkValue
import com.baselibrary.utils.GlideUtils
import com.baselibrary.utils.NumberUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.media.R

/**
 * @author: 关忆北、
 * @date: 2022/4/20
 * @Des：
 */
class DynamicSearchTopicAdapter : BaseQuickAdapter<ReleaseTopicBean.DataBean, BaseViewHolder>(R.layout.item_dynamic_search_topic) {
    override fun convert(helper: BaseViewHolder, bean: ReleaseTopicBean.DataBean) {
        helper
            .setText(R.id.tv_searchTopic_title, "#${bean.name.checkValue()}")
            .setText(R.id.tv_searchTopic_browse, "${bean.dynamicNum}条内容 · ${NumberUtils.formatBigNum(bean.viewNum.toString())}浏览")
            .setText(R.id.tv_searchTopic_des, bean.desc)
        GlideUtils.loadImg_101(mContext.applicationContext,if(bean.img.checkNotNull()) bean.img else  bean.cover, helper.getView(R.id.round_searchTopic_cover))
    }

}